/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package svp;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 075087
 */
@Entity
@Table(name = "product_tbl")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProductTbl.name", query = "SELECT p.productName FROM ProductTbl p"),
    @NamedQuery(name = "ProductTbl.findAll", query = "SELECT p FROM ProductTbl p"),
    @NamedQuery(name = "ProductTbl.findByProductCode", query = "SELECT p FROM ProductTbl p WHERE p.productCode = :productCode"),
    @NamedQuery(name = "ProductTbl.findByProductName", query = "SELECT p FROM ProductTbl p WHERE p.productName = :productName"),
    @NamedQuery(name = "ProductTbl.findByProductcompanyID", query = "SELECT p FROM ProductTbl p WHERE p.productcompanyID = :productcompanyID")})
public class ProductTbl implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "product_code")
    private String productCode;
    @Column(name = "product_name")
    private String productName;
    @Column(name = "product_companyID")
    private String productcompanyID;

    public ProductTbl() {
    }

    public ProductTbl(String productCode) {
        this.productCode = productCode;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductcompanyID() {
        return productcompanyID;
    }

    public void setProductcompanyID(String productcompanyID) {
        this.productcompanyID = productcompanyID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (productCode != null ? productCode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductTbl)) {
            return false;
        }
        ProductTbl other = (ProductTbl) object;
        if ((this.productCode == null && other.productCode != null) || (this.productCode != null && !this.productCode.equals(other.productCode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "svp.ProductTbl[ productCode=" + productCode + " ]";
    }
    
}
